package com.blb.mapper;

import com.blb.entity.Vehicle;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author HuaHao
 * @since 2019-11-16
 */

public interface VehicleMapper extends BaseMapper<Vehicle> {

    List<Vehicle> findVehicle(@Param("vehicleName") String vehicleName,@Param("number") String number);

    @Select("select remarks from t_vehicle where vehicle_id= #{id}")
    String findReamrksById(@Param("id") String id);

    @Update("UPDATE t_vehicle SET vehicle_name=#{vehicleName}, number_plate=#{numberPlate}, vehicle_type=#{vehicleType},driver_capacity=#{driverCapacity},logistics_id=#{logisticsId}, driver_id=#{driverId}, driver_size=#{driverSize}, remarks=#{remarks} WHERE vehicle_id=#{vehicleId}")
    public void updateVehicle(Vehicle vehicle);

    public int getAllCount(@Param("vehicleName") String vehicleName,@Param("companyId") String  companyId,@Param("number") String number);

    public List<Vehicle> findAll(@Param("vehicleName") String vehicleName,@Param("companyId") String  companyId, @Param("number") String number, @Param("start") int start, @Param("length") int length);
}
